﻿<ResourceDictionary 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows"
    xmlns:local="clr-namespace:Coding4Fun.Phone.Controls">
	<!-- Resource dictionary entries should be defined here. -->

    <DataTemplate x:Key="MenuItemActionDefaultTemplate">
        <TextBlock Text="{Binding Content}" />
    </DataTemplate>

    <Style x:Key="EmptyButtonStyle"
           TargetType="primitives:ButtonBase">
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:ButtonBase">
                    <Border 
						Background="{TemplateBinding Background}"
                        Padding="{TemplateBinding Padding}">
                        <ContentPresenter 
							HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:AppBarPromptItem" BasedOn="{StaticResource EmptyButtonStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AppBarPromptItem">
                    <Grid Margin="0,2,0,13">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled" />
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>

						<Rectangle Fill="{StaticResource TransparentBrush}" />

						<TextBlock 
							Name="ContentContainer"
                            Margin="24,0"
                            Text="{TemplateBinding Content}"
                            Foreground="{TemplateBinding Foreground}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            Padding="{TemplateBinding Padding}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Style="{StaticResource PhoneTextNormalStyle}"
                            FontSize="{StaticResource PhoneFontSizeExtraLarge}"
                            FontFamily="Segoe WP SemiLight" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:AppBarPrompt">
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}" />
		<Setter Property="VerticalAlignment" Value="Bottom" />
		<Setter Property="Background" Value="{StaticResource PhoneChromeBrush}" />
		
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AppBarPrompt">
					<Grid Background="{TemplateBinding Background}">
						<StackPanel x:Name="Body" />
					</Grid>
				</ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>